<template>
  <div class="tab">
    <div 
      class="tab-item"
      v-for="(item, index) of tabData"
      :key="index">
      <tab-icon
        :iconText="item.iconText"
        :path="item.path"
        >{{ item.tabText }}</tab-icon>
    </div>
  </div>
</template>

<script>
import TabIcon from './Icon'
import tabData from '@/data/tab'
import { reactive } from 'vue'
export default {
  name: 'Tab',
  components: {
    TabIcon
  },
  setup() {
    const state = reactive({
      tabData
    })

    return {
      ...state
    }
  }
}
</script>

<style lang="scss" scoped>
  .tab {
    bottom: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 60px;
    border: 1px solid #ddd;
    background-color: #fff;

    .tab-item {
      display: inline-block;
      width: 33.33%;
      height: 100%;
      text-align: center;
      line-height: 25px;
    }
    a {
      text-decoration: none;
    }
  }
</style>